package com.qf.service.impl;

import com.qf.entity.Emp;
import com.qf.entity.PageInfo;
import com.qf.mapper.DeptMapper;
import com.qf.mapper.EmpMapper;
import com.qf.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

/**
 * User: key
 * ClassName:EmpServiceImpl
 * Date: 2023/5/26
 * Time: 19:38
 * description:
 */
@Service
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpMapper empMapper;
    @Override
    public List<Emp> selectAll() throws SQLException {
        return empMapper.selectAll();
    }


    @Override
    public Emp select(Emp emp) throws SQLException {
        return empMapper.select(emp);
    }

    @Override
    public Emp select(Integer eno) throws SQLException {
        return empMapper.select(eno);
    }

    @Override
    @Transactional
    public Integer insert(Emp emp) throws SQLException {
        return empMapper.insert(emp);
    }

    @Override
    @Transactional
    public Integer update(Emp emp) throws SQLException {
        return empMapper.update(emp);
    }

    @Override
    @Transactional
    public Integer delete(Integer eno) throws SQLException {
        return empMapper.delete(eno);
    }

    @Override
    @Transactional
    public Emp select(String username, String password) throws SQLException {
        return empMapper.selectBy(username,password);
    }

    @Override
    public Integer deleteByIds(List<Emp> emp) {
        return empMapper.deleteByIds(emp);
    }

    @Override
    public List<Emp> selectByEnos(List<Integer> enos) throws SQLException {
        return empMapper.selectByEnos(enos);
    }


}
